
package gov.chinatax.ctcps.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for zfzbDr.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="zfzbDrForm"
 */
public class ZfzbDrForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _drbh = null;
   private java.lang.String _nd = null;
   private java.lang.String _xh = null;
   private java.lang.String _cflxDm = null;
   private java.lang.String _zffsDm = null;
   private java.lang.String _zclxDm = null;
   private java.lang.String _kmbm = null;
   private java.lang.String _xmbm = null;
   private java.math.BigDecimal _czje = null;
   private java.math.BigDecimal _xtje = null;
   private java.lang.String _dwbh = null;
   private java.lang.String _zt1 = null;
   private java.lang.String _zt2 = null;

   /**
    * Standard constructor.
    */
   public ZfzbDrForm() {
   }

   /**
    * Returns the drbh
    *
    * @return the drbh
    */
   public java.lang.String getDrbh() {
      return _drbh;
   }

   /**
    * Sets the drbh
    *
    * @param drbh the new drbh value
    */
   public void setDrbh(java.lang.String drbh) {
      _drbh = drbh;
   }
   /**
    * Returns the nd
    *
    * @return the nd
    */
   public java.lang.String getNd() {
      return _nd;
   }

   /**
    * Sets the nd
    *
    * @param nd the new nd value
    */
   public void setNd(java.lang.String nd) {
      _nd = nd;
   }
   /**
    * Returns the xh
    *
    * @return the xh
    */
   public java.lang.String getXh() {
      return _xh;
   }

   /**
    * Sets the xh
    *
    * @param xh the new xh value
    */
   public void setXh(java.lang.String xh) {
      _xh = xh;
   }
   /**
    * Returns the cflxDm
    *
    * @return the cflxDm
    */
   public java.lang.String getCflxDm() {
      return _cflxDm;
   }

   /**
    * Sets the cflxDm
    *
    * @param cflxDm the new cflxDm value
    */
   public void setCflxDm(java.lang.String cflxDm) {
      _cflxDm = cflxDm;
   }
   /**
    * Returns the zffsDm
    *
    * @return the zffsDm
    */
   public java.lang.String getZffsDm() {
      return _zffsDm;
   }

   /**
    * Sets the zffsDm
    *
    * @param zffsDm the new zffsDm value
    */
   public void setZffsDm(java.lang.String zffsDm) {
      _zffsDm = zffsDm;
   }
   /**
    * Returns the zclxDm
    *
    * @return the zclxDm
    */
   public java.lang.String getZclxDm() {
      return _zclxDm;
   }

   /**
    * Sets the zclxDm
    *
    * @param zclxDm the new zclxDm value
    */
   public void setZclxDm(java.lang.String zclxDm) {
      _zclxDm = zclxDm;
   }
   /**
    * Returns the kmbm
    *
    * @return the kmbm
    */
   public java.lang.String getKmbm() {
      return _kmbm;
   }

   /**
    * Sets the kmbm
    *
    * @param kmbm the new kmbm value
    */
   public void setKmbm(java.lang.String kmbm) {
      _kmbm = kmbm;
   }
   /**
    * Returns the xmbm
    *
    * @return the xmbm
    */
   public java.lang.String getXmbm() {
      return _xmbm;
   }

   /**
    * Sets the xmbm
    *
    * @param xmbm the new xmbm value
    */
   public void setXmbm(java.lang.String xmbm) {
      _xmbm = xmbm;
   }
   /**
    * Returns the czje
    *
    * @return the czje
    */
   public java.math.BigDecimal getCzje() {
      return _czje;
   }

   /**
    * Sets the czje
    *
    * @param czje the new czje value
    */
   public void setCzje(java.math.BigDecimal czje) {
      _czje = czje;
   }
   /**
    * Returns the xtje
    *
    * @return the xtje
    */
   public java.math.BigDecimal getXtje() {
      return _xtje;
   }

   /**
    * Sets the xtje
    *
    * @param xtje the new xtje value
    */
   public void setXtje(java.math.BigDecimal xtje) {
      _xtje = xtje;
   }
   /**
    * Returns the dwbh
    *
    * @return the dwbh
    */
   public java.lang.String getDwbh() {
      return _dwbh;
   }

   /**
    * Sets the dwbh
    *
    * @param dwbh the new dwbh value
    */
   public void setDwbh(java.lang.String dwbh) {
      _dwbh = dwbh;
   }
   /**
    * Returns the zt1
    *
    * @return the zt1
    */
   public java.lang.String getZt1() {
      return _zt1;
   }

   /**
    * Sets the zt1
    *
    * @param zt1 the new zt1 value
    */
   public void setZt1(java.lang.String zt1) {
      _zt1 = zt1;
   }
   /**
    * Returns the zt2
    *
    * @return the zt2
    */
   public java.lang.String getZt2() {
      return _zt2;
   }

   /**
    * Sets the zt2
    *
    * @param zt2 the new zt2 value
    */
   public void setZt2(java.lang.String zt2) {
      _zt2 = zt2;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getDrbh() == null) {
         errors.add("drbh", new ActionError("error.drbh.required"));
      }
      if(getNd() == null) {
         errors.add("nd", new ActionError("error.nd.required"));
      }
      if(getCflxDm() == null) {
         errors.add("cflxDm", new ActionError("error.cflxDm.required"));
      }
      if(getZffsDm() == null) {
         errors.add("zffsDm", new ActionError("error.zffsDm.required"));
      }
      if(getZclxDm() == null) {
         errors.add("zclxDm", new ActionError("error.zclxDm.required"));
      }
      if(getKmbm() == null) {
         errors.add("kmbm", new ActionError("error.kmbm.required"));
      }
      if(getCzje() == null) {
         errors.add("czje", new ActionError("error.czje.required"));
      }
      if(getXtje() == null) {
         errors.add("xtje", new ActionError("error.xtje.required"));
      }
      if(getDwbh() == null) {
         errors.add("dwbh", new ActionError("error.dwbh.required"));
      }
      // TODO test format/data
      return errors;
   }
}
